<?php

/*
 * Author->Gyan
  Copyright (c) 2013 ASR Market Ventures Private Limited. All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:* */

class SkillConfig {

    const STATUS_ACTIVE = 1;
    const STATUS_DEACTIVE = 0;
    const ACTIVE_COUNTRY = 99;
    const ACTIVE_STATE = 1483;
    const ACTIVE_CITY = 1;
    const DESCRIPTION_CLASS_COURSE = 1;
    const STRUCTURE_CLASS_COURSE = 2;
    const OUTCOME_CLASS_COURSE = 3;
    const FUN_LEARING_LIMIT = 100;
    const USER_TRAINER = 1;
    const WEB_USER = 2;
    const MAX_FILE_UPLOAD_LIMIT = 7;
    const MAX_IMAGE_SIZE_UPLOAD = 2000000;
    const MAX_IMAGE_SIZE = 'Max upload size 2 Mb';
    const locality_Adress = ' Delhi ncr,India';

    //show image when field name=status
    public static function status($data) {
        $image = ($data->status == self::STATUS_ACTIVE) ? 'active' : 'deactive';
        return baseUrl() . 'images/' . $image . '.png';
    }

    //show image when field name=is_active
    public static function Activestatus($data) {
        $image = ($data->is_active == self::STATUS_ACTIVE) ? 'active' : 'deactive';
        return baseUrl() . 'images/' . $image . '.png';
    }

    public static function getaftersaveClassImagePath($userId) {
        return '/../upload/course-image/image/';
    }

    public static function CreateDateTime() {
        return date("Y-m-d H:i:s");
    }

    public static function getClassCourseImagethumbsPath($userId) {
        return $userId . '/class-course-image/thumbs/';
    }

    public static function getClassCourseImagePath($userId) {
        return $userId . '/class-course-image/';
    }

    public static function getaftersaveClassCourseImagePath($userId) {
        return $userId . '/class-course-image/image/';
    }

    public static function getClassImagePath() {
        return '/../upload/class-course-image/image/';
    }

    public static function isPostOwner($userType) {
        if (Yii::app()->user->isGuest)
            return true;
        return false;
    }

}

?>